package com.example.android;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.graphics.Color;
import android.location.GnssAntennaInfo;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    private Button Btn01;
    private Button Btn02;
    private Button Btn03;
    private Button Btn04;
    private TextView Title;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        //设置全屏
        //getWindow().setFlags(Window.LayoutParam.FLAG_FULLSCREEN);
        setContentView(R.layout.buju);

        Title = (TextView)findViewById(R.id.MainTitle);
        Btn01 = (Button)findViewById(R.id.Btn01);
        Btn01.setFocusableInTouchMode(true);
        Btn01.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View view, boolean b) {
                if(b){
                    Btn01.setBackgroundColor(Color.RED);
                }
                else{
                    Btn01.setBackgroundColor(Color.GREEN);
                }
            }
        });
        //设置点击事件
        Btn01.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Btn01.setFocusable(false);
            }
        });

        Btn02 = (Button)findViewById(R.id.Btn02);
        Btn03 = (Button)findViewById(R.id.Btn03);
        Btn04 = (Button)findViewById(R.id.Btn04);
    }


    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case Btn02:
                Intent Picture =new Intent(picture.activity.this,Sectivity.class);
        }
    }
}
